<script setup>
import {ref} from "vue"
import {useRouter} from 'vue-router'
import useNightModeStore from "../stores/nightModeStore";
const router=useRouter();
const nightModeStore=useNightModeStore();
//定义的夜间模式数据放到pinia里
// const isNight=ref(true);
// const changeMod=()=>{
//     isNight.value=!isNight.value;
// }
//使用pinia的函数
const changeMod=()=>{
    nightModeStore.changeMode();
}
</script>
<template>
    <div :style="{width:'100%',height:'100vh', 
    backgroundColor:nightModeStore.isNight?'#555':'white',
    color:nightModeStore.isNight?'white':'black'}">
    <div class="back">
        <div class="go">
        <i @click="router.back()" class="back"></i>
    </div>
</div>
    <div class="tb">
        <p class="dl">登录知乎日报</p>
        <p class="xz">选择登录方式</p>
     <i class="zhihu" ><img src="../assets/zhihu.jpg" ></i>
     <i class="weibo"><img src="../assets/weibo.jpg" ></i>
<div class="op">
     <form>
        <input type="radio" name="option" >
        <label for="option">我同意 <a class="a">《知乎协议》</a>和<a class="a">《个人信息保护指引》</a></label>
     </form>
    </div>
    
    </div>
     <div class="set" >
        <i @click="nightModeStore.changeMode()" :class="nightModeStore.isNight?'':'light'">
            <span>{{nightModeStore.isNight?"夜间模式":"白天模式"}}</span></i>
        <i class="userset" @click="router.back()">
            <span>设置</span></i>
    </div>
</div>
</template>
<style scoped>
.back{
    width: 100%;
}
.go{
    width: 30px;
    height: 50px;
    line-height: 50px;
    background: url(../assets/fanhui.png) center center no-repeat;
    background-size: 20px 20px;
    border-top-left-radius: 30px;
}
.go i{
    float: left;
    width: 50px;
    height: 50px;
    background-image: url(../assets/fanhui.png);
}
.a {
    color: blue;
} 
.op{
    position: absolute;
  justify-content: center;
  top:290px;
  font-size: 15px;
}
.xz{
    position: absolute;
  justify-content: center;
  top:165px;
  font-size: 15px;
  color: #aaa;
}
.dl{
    position: absolute;
  justify-content: center;
  top:120px;
  font-size: 25px;
  font-family: "正楷";
  
}
.tb{
    display: flex;
  justify-content: center;
  align-items: center;
  height:55vh;
 
}
.zhihu img{
    background: url("../assets/zhihu.jpg");
    width: 45px;
    height:45px;
    align-items: center;
    border-radius:40px;
}
.weibo img{
    margin-left: 15px;
    background: url("../assets/zhihu.jpg");
    width: 45px;
    height:45px;
    align-items: center;
    border-radius: 40px;
}
.set{
    position: fixed;
    width: 100%;
    height: 50px;
    bottom: 50px;
    display: flex;
    justify-content:space-evenly;
}
.set i{
    font-style: normal;
    height: 50px;
    background: url(../assets/yejianmoshi.png)no-repeat center top;
    background-size:30px 30px ;
    display: flex;
    align-items: flex-end;
    font-size: 14px;
}
.set i.light{
    background-image: url(../assets/baitianmoshi.png)
}
.set i.userset{
   background-image: url(../assets/shezhi.png);
}
</style>